<template>
	<view class="item" v-for="item in list" :key="item.id">
		<image src="../../../../static/images/Shop/service.png" mode="heightFix"></image>
		<view class="text">
			<view class="topText">
				<text class="Msg">{{item.title}}</text>
				<text class="time">3分钟前</text>
			</view>
			<view class="buttomText">
				<view class="title">
					<view class="left">
						<text class="leftText">托管</text>{{item.content}}
					</view>
					<uni-icons class="icons"  type="right" size="22"></uni-icons>
				</view>
			</view>
		</view>
		<view class="Prompt"></view>
	</view>
</template>

<script lang="ts" setup>
	import { watchEffect,ref } from 'vue';
	import { getHomeMsgApi } from '@/api/home'
	const list = ref()
	const props = defineProps({
		num: {
			type: Number
		}
	})
	watchEffect(async () => {
		console.log('receivedData changed:', props.num); // 监听receivedData的变化
		const {rows} = await getHomeMsgApi(props.num)
		console.log(rows)
		list.value = rows
	});
</script>

<style lang="scss" scoped>
	.icons{
		color: #fff !important;
	}
	// 列表数据


	.item {
		position: relative;

		width: 100%;
		height: 165px;
		background: rgba(255, 255, 255, 0.1);
		border-radius: 16px;
		margin-bottom: 24px;
		padding: 23px 32px;
		box-sizing: border-box;
		display: flex;

		.Prompt {
			position: absolute;
			top: 20px;
			right: 32px;
			height: 15px;
			width: 15px;
			border-radius: 20px;
			background: red;
		}

		image {
			height: 100%;
		}

		.text {
			margin-left: 24px;
			flex: 1;

			.topText {
				height: 40px;
				width: 100%;
				padding-top: 15px;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.Msg {
					font-size: 28px;
					color: #fff;
				}

				.time {
					font-size: 24px;
					color: #7b7b7d;
				}
			}

			.buttomText {
				height: 40px;
				width: 100%;
				padding-top: 15px;

				.title {
					display: flex;
					align-items: center;
					justify-content: space-between;

					.left {
						font-size: 24px;
						color: #fff;

						.leftText {
							display: inline-block;
							font-size: 20px;
							border-radius: 20px;
							padding: 0 8px;
							margin-right: 15px;
							border: 1px solid #00D0B9;
							color: #00D0B9;
						}
					}

					.van-icon {
						font-size: 24px;
						color: #fff;
					}
				}

			}
		}

	}
</style>